package com.zy.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zy.entity.Order;
import com.zy.mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class OrderService extends ServiceImpl<OrderMapper, Order> {
    OrderMapper mapper;
    @Autowired
    public OrderService(OrderMapper mapper){
        this.mapper=mapper;
    }
    public List<Order> getAll(){return mapper.getAll();}
    public Order getById(Long id){return mapper.getById(id);}
    public Long insert(Order entity){
        return Long.valueOf(mapper.insert(entity));
    }
    public boolean update(Order entity){
        int result=mapper.update(entity);
        return result>0?true:false;
    }
    public boolean delete(Long id){
        int result=mapper.deleteById(id);
        return result>0?true:false;
    }
}